package org.fuxia.im.db;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.hibernate.HibernateException;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.id.IdentifierGenerator;

public class IdGenerator implements IdentifierGenerator
{

	private static final DateFormat	df	= new SimpleDateFormat("yyyyMMddHHmmssS");

	public Serializable generate(SessionImplementor session , Object object) throws HibernateException
	{
		return df.format(new Date());
	}

}
